from django.urls import re_path
from rest_framework.routers import DefaultRouter
from rest_framework_jwt.views import obtain_jwt_token
from xj_users import views

urlpatterns = [
    # 短信验证码
    re_path(r'^sms_codes/(?P<mobile>1[3-9]\d{9})/$', views.SMSCodeView.as_view()),

    # 关注用户和取消关注
    re_path(r'^users/like/(?P<pk>\d+)/$', views.UserLikeView.as_view()),

    # 注册
    re_path(r'^users/$', views.RegisterView.as_view()),

    # 登入
    # re_path(r'^authorizations/$', views.LoginView.as_view()),
    re_path(r'^authorizations/$', obtain_jwt_token),

    # 修改密码
    re_path(r'^user/password/$', views.ChangePasswordView.as_view()),

    # 修改擅长技术
    re_path(r'^user/label/$', views.UpdatelabelView.as_view()),

    # 用户中心
    re_path(r'^user/$', views.UserView.as_view()),

    # 上传图片
    re_path(r'^upload/avatar/$', views.UserAvatar.as_view()),

    # 前端富文本编辑器上传图片
    re_path(r'^upload/common/$', views.CommonView.as_view()),

]

#创建router实例
# router = DefaultRouter()
#注册路由

# 标签
# router.register(r'labels',views.LabelsView,basename='labels')
# urlpatterns += router.urls
